import request from '@/utils/request'
import { renderUrl } from '../utils'

const headers = {
  'Content-Type': 'application/json'
}

export function add(data) {
  return request({
    url: '/admin/productType/add',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function edit(data) {
  return request({
    url: '/admin/productType/edit',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function del(data) {
  return request({
    url: '/admin/productType/del',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function getProductTypeList(data) {
  return request({
    url: '/admin/productType/list',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}


export function getTypelist(data) {
  return request({
    url: '/admin/productType/getType',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}
export function productTypegetType(data) {
  return request({
    url: renderUrl('/admin/productType/getType/{id}', data),
    method: 'get'
  })
}

export default { add, edit, del }
